package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BaseAreas;
import com.nmf.dao.gen.bean.BaseAreasExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BaseAreasMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @SelectProvider(type=BaseAreasSqlProvider.class, method="countByExample")
    long countByExample(BaseAreasExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @DeleteProvider(type=BaseAreasSqlProvider.class, method="deleteByExample")
    int deleteByExample(BaseAreasExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @Delete({
        "delete from base_areas",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @Insert({
        "insert into base_areas (id, area, ",
        "city_id, city_name, ",
        "create_date, update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, ",
        "#{cityId,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BaseAreas record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @InsertProvider(type=BaseAreasSqlProvider.class, method="insertSelective")
    int insertSelective(BaseAreas record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @SelectProvider(type=BaseAreasSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BaseAreas> selectByExample(BaseAreasExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @Select({
        "select",
        "id, area, city_id, city_name, create_date, update_date",
        "from base_areas",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BaseAreas selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @UpdateProvider(type=BaseAreasSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BaseAreas record, @Param("example") BaseAreasExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @UpdateProvider(type=BaseAreasSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BaseAreas record, @Param("example") BaseAreasExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @UpdateProvider(type=BaseAreasSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BaseAreas record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table base_areas
     */
    @Update({
        "update base_areas",
        "set area = #{area,jdbcType=VARCHAR},",
          "city_id = #{cityId,jdbcType=VARCHAR},",
          "city_name = #{cityName,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BaseAreas record);
}